package cfca.paperless.client.servlet._3_assist._3_22_checkNetWorkConn;

import cfca.paperless.client.servlet.PaperlessClient;
import cfca.paperless.client.servlet.PaperlessConfig;
import cfca.sadk.util.Base64;

/**
 * @description 验证网络通信服务是否正常
 * @author zf
 * @date : 2018-5-21 下午5:10:07
 * @reviewed by 
 */
public class CheckNetWorkConnTest01 {

    public static void main(String[] args) throws Exception {

        long timeStart = System.currentTimeMillis();// 开始时间

        System.out.println("CheckNetWorkConnTest01 START");

        PaperlessClient clientBean = new PaperlessClient(PaperlessConfig.assistUrl, 10000, 60000);// 无纸化辅助接口的访问URL
        String testMsg ="Test communications";
        // 取得预植场景证书的数量
        String result = clientBean.checkNetWorkConn(testMsg);
        result = new String(Base64.decode(result.getBytes(PaperlessConfig.DEFAULT_CHARSET)),PaperlessConfig.DEFAULT_CHARSET);
        System.out.println("CheckNetWorkConnTest01 result="+ result);
        System.out.println("CheckNetWorkConnTest01 END");

        long timeEnd = System.currentTimeMillis();// 结束时间
        System.out.println("##########" + "time used:" + (timeEnd - timeStart) + "##########");
    }

    
}
